import request from '/src/utils/request.js'

//获取所有饮食数据

export const getDietListApi = (name, categoryId, status, page, pageSize) => {
  return request.get(
    `/diets?name=${name}&categoryId=${categoryId}&status=${status}&page=${page}&pageSize=${pageSize}`
  )
}


//根据id获取菜品的详情  方案一
export const getDietByIdApi = (id) => request.get('/diets/id', {
  params: {
    id
  }
})

//根据id获取菜品的详情  方案二
// export const getDietByIdApi = (id) => request.get(`/diets/${id}`)

//新增菜品
export const addDietApi = (dishData) => request.post('/diets/add', dishData)

//修改菜品数据
export const updateByIdDietApi = (dishData) => request.put('/diets/update', dishData)

//删除菜品数据
export const delDietByIdsApi = (ids) => request.delete(`/diets/delete?ids=${ids}`)
